package hzau.filter;


import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
@WebFilter(urlPatterns = "/*")
@Slf4j
public class TimeFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        Long start=System.currentTimeMillis();
        filterChain.doFilter(servletRequest,servletResponse);
        Long end=System.currentTimeMillis();
        log.info(String.valueOf(end-start));
    }
}
